<template>
  <div ref="charRef" style="width:600px; height:400px">
  </div>
</template>

<script>
import * as echarts from 'echarts'// 引入依赖
// 按需引入，没办法用cdn，只有全局引用才可以用cdn
// import { TitleComponent, LegendComponent } from 'echarts/components'
// import { RadarChart } from 'echarts/charts'
// import { CanvasRenderer } from 'echarts/renderers'
// echarts.use([TitleComponent, LegendComponent, RadarChart, CanvasRenderer])
export default {
  name: 'Rador',
  components: {},
  data() {
    return {

    }
  },
  created() {},
  mounted() {
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(this.$refs.charRef)
    // 绘制图表
    myChart.setOption({
      title: {
        text: '个人工作绩效表'
      },
      //   legend: {
      //     data: ['Allocated Budget', 'Actual Spending']
      //   },
      radar: {
        // shape: 'circle',
        indicator: [
          { name: '考勤', max: 6500 },
          { name: '工资', max: 16000 },
          { name: '代码质量', max: 30000 },
          { name: '工作积极性', max: 38000 },
          { name: '加班时长', max: 52000 },
          { name: 'bug数量', max: 25000 }
        ]
      },
      series: [
        {
          name: 'Budget vs spending',
          type: 'radar',
          data: [
            {
              value: [4200, 3000, 20000, 35000, 50000, 18000],
              name: 'Allocated Budget'
            },
            {
              value: [5000, 14000, 28000, 26000, 42000, 21000],
              name: 'Actual Spending'
            }
          ]
        }
      ]
    })
  },
  methods() {

  }
}
</script>

  <style lang="scss" scoped>

  </style>
